package cn.chencq.page;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import com.github.pagehelper.Page;

public class PageBean<T> implements Serializable {

	private int pageNum; // 当前页
	private int pageSize; // 每页显示多少条

	private long totalCount;// 总记录数
	private int totalPage; // 总页数

	private List<T> recordList = new ArrayList<T>(0); // 本页的数据列表

	public PageBean() {
	}

	public PageBean(Page page, List<T> recordList) {
		this.pageNum = page.getPageNum();
		this.pageSize = page.getPageSize();
		this.totalCount = page.getTotal();
		this.totalPage = page.getPages();
		this.recordList.addAll(recordList);
	}

	public int getPageNum() {
		return pageNum;
	}

	public void setPageNum(int pageNum) {
		this.pageNum = pageNum;
	}

	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

	public long getTotalCount() {
		return totalCount;
	}

	public void setTotalCount(long totalCount) {
		this.totalCount = totalCount;
	}

	public int getTotalPage() {
		return totalPage;
	}

	public void setTotalPage(int totalPage) {
		this.totalPage = totalPage;
	}

	public List<T> getRecordList() {
		return recordList;
	}

	public void setRecordList(List<T> recordList) {
		this.recordList = recordList;
	}

}
